Filtering examples

This simulation file provides examples of using the different filtering components included in CLEM.

Ruminant filters simulation

This simulation shows the range of ruminant filters provided.

The simulation creates a Ruminant herd with a variety of individuals. We will use the Ruminant herd report component provided as a child of the Activities holder to see the results of filtering. This Herd report component reports a list of individuals each time step (a single month in this example based on the Clock settings). The APSIM Report component in the Reports folder is set to report whenever the [ReportHerd].OnReportItemGenerated event is fired. This event is fired by ReportHerd component once for each individual selected each time step, and provides the Ruminant object for the report to access and write the property values to the output database. The individual is accessed in the report through [ReportHerd].ReportDetails.Individual in the variables section of the Report properties. This example also includes a Resource ledger report reporting each individual created (initialised) in the simulation to compare the entire population.

The Ruminant herd report expects a Ruminant group component as a child which is used to provide the rules to filter the herd and supply the individuals for reporting. A selection of various Filter types are provided as children of the Ruminant filter group and all are disabled when you open the simulation. You can enable and disable the components supplied, run the model, and view the output data (Select the Reports.Report, and see the Data Tab). This will show the individuals selected and reported to the database.

This example simulation also provides a great example of only needing to provide the details needed for the simulation in the simulation tree. In this example, we only need a Ruminant herd, Ruminant type, Ruminant initial cohorts with a list of Ruminant initial cohort, the Ruminant herd report, and APSIM Report, and a Ruminant group with various filters. We also require the Clock, CLEM Events and Random number generator.

This next section will guide you through the expected functionality.

See all examples